package com.eric.controller;
import com.eric.domain.po.Account;
import com.eric.domain.vo.AccountVO;
import com.eric.service.AccountService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/account")
public class AccountController {

    @Resource
    private AccountService accountService;

    @GetMapping("/all")
    public List<AccountVO> getAllAccountList(){
       return accountService.getAllAccountList();
    }

    @GetMapping("/{id}")
    public Account getOneById(@PathVariable Integer id){
        return accountService.getOneById(id);
    }

}
